#include "CmnServer.h"
using namespace std;
int main()
{
	cout<<"server"<<endl;
	AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0);
	AfxSocketInit();
	CSocket serverSocket;
	serverSocket.Create(3333);
	serverSocket.Listen();
	CSocket clientSocket;
	CServer X;
	while(1)
	{
		serverSocket.Accept(clientSocket);
		char msg[200];
		if(clientSocket.Receive(msg, 200)<0)break;
		cout<<"Client: "<<msg<<endl;
		using namespace serverCode;
		X.DealWith(msg,clientSocket);
		clientSocket.Close();
	}
	return 0;
}